/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - geometry/containment
// Copyright( c) 2015.  All Rights Reserved
//
// File:		AEStaticMeshInstance.cpp
// Author:		Gianluca Belardelli
// Date:		19/06/2015
//
/////////////////////////////////////////////////////////////////////////
#include <AEEngine.h>

AEStaticMeshInstance::AEStaticMeshInstance( void ) : m_spMesh( AENULL )
{
}

AEStaticMeshInstance::~AEStaticMeshInstance( void )
{
}

void AEStaticMeshInstance::Release( void )
{
}

void AEStaticMeshInstance::ReComputeBoundingBoxes( AEBOOL32 bAccurate )
{
}

AEBOOL32 AEStaticMeshInstance::GetZoneLocalSpacePosition( AEVector4f &vcDest )
{
	return AEFALSE;
}

void AEStaticMeshInstance::AllocateSubmeshInstances( AEINT32 nNumInstances )
{
	AEASSERT( nNumInstances > 0 );
	if( m_lpSubmeshInstances != AENULL )
		FreeSubmeshInstances();

	// Alloca con il placement un array di nNumMeshes
	AEMemoryManager *lpPtr = AEMemoryManager::GetInstancePtr();
	m_lpSubmeshInstances = (AEStaticSubmeshInstance *) ( AEngine::GetMemManager()->GetHeapAllocator().BlockAlloc( nNumInstances * sizeof( AEStaticSubmeshInstance ) ) );
	AEStaticSubmeshInstance *lpPlacement = m_lpSubmeshInstances;
	
	for( AEINT32 i=0; i<nNumInstances; i++ )
	{
		lpPlacement = new ( lpPlacement ) AEStaticSubmeshInstance();
		lpPlacement++;
	}

	m_nNumSubmeshInstances = nNumInstances;

	for( AEINT32 i=0; i<m_nNumSubmeshInstances; i++ )
	{
		m_lpSubmeshInstances[i].m_lpMeshInstance = this;
		m_lpSubmeshInstances[i].m_lpSubmesh = m_spMesh->GetSubmesh( i );
	}
}

void AEStaticMeshInstance::LinkSubmeshInstances( void )
{
}

void AEStaticMeshInstance::FreeSubmeshInstances( void )
{
}

void AEStaticMeshInstance::AssignToVisibilityZones( void )
{
}

void AEStaticMeshInstance::RemoveFromVisibilityZones( void )
{
}

void AEStaticMeshInstance::SetCollisionBitmask( AEUINT32 uiCollisionMask, AECollisionBehavior eCollisionBehavior )
{
}

void AEStaticMeshInstance::SetCollisionBehavior( AECollisionBehavior eCollisionBehavior )
{
}

void AEStaticMeshInstance::ResetStaticLighting( void )
{
}

AEBOOL32 AEStaticMeshInstance::IsLightmapped( void ) const
{
	return AEFALSE;
}
	